package com.baida.retail.tasksystem.dao.impl;

import com.baida.retail.tasksystem.dao.OrderItemDao;
import com.baida.retail.tasksystem.entity.OrderItem;
import com.baida.retail.tasksystem.mapper.ext.OrderItemMapperExt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class OrderItemDaoImpl implements OrderItemDao {
    @Autowired
    private OrderItemMapperExt orderItemMapperExt;

    @Override
    public int increaseRefundedQuantity(Long recordId, int refundedQuantity) {
        return orderItemMapperExt.increaseRefundedQuantity(recordId, refundedQuantity);
    }

    @Override
    public int updateOutOfStockQuantity(Long recordId, int outOfStockQuantity) {
        return orderItemMapperExt.updateOutOfStockQuantity(recordId, outOfStockQuantity);
    }

    @Override
    public int increaseSortedQuantity(Long recordId) {
        return orderItemMapperExt.increaseSortedQuantity(recordId);
    }

    @Override
    public OrderItem getByRecordId(Long recordId) {
        return orderItemMapperExt.selectByRecordId(recordId);
    }

    @Override
    public List<OrderItem> getByOrderId(Long orderId) {
        return orderItemMapperExt.selectByOrderId(orderId);
    }

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return orderItemMapperExt.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(OrderItem record) {
        return orderItemMapperExt.insert(record);
    }

    @Override
    public int insertSelective(OrderItem record) {
        return orderItemMapperExt.insertSelective(record);
    }

    @Override
    public OrderItem selectByPrimaryKey(Integer id) {
        return orderItemMapperExt.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(OrderItem record) {
        return orderItemMapperExt.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(OrderItem record) {
        return orderItemMapperExt.updateByPrimaryKey(record);
    }
}
